win32: Set the surface type
authorMatthias Clasen <mclasen@redhat.com>
Tue, 21 May 2019 23:41:00 +0000 (23:41 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:16 +0000 (20:25 +0000)
This is copying some code from the corresponding
create_surface implementations of the other backends.

gdk/win32/gdksurface-win32.c

index 6b3d012db408555a5eef36da3f6936ba31cf9f32..c0eeddfeee49b03abd4188f4e84f085f682f6aae 100644 (file)
@@ -484,6 +484,7 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
   RECT rect;
   GdkWin32Surface *impl;
   GdkWin32Display *display_win32;
+  GdkSurface *surface;
   const gchar *title;
   wchar_t *wtitle;
   gint window_width, window_height;
@@ -513,6 +514,13 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
                        "frame-clock", frame_clock,
                        NULL);
 
+  surface = GDK_SURFACE (impl);
+  surface->surface_type = surface_type;
+  surface->x = x;
+  surface->y = y;
+  surface->width = width;
+  surface->height = height;
+
   impl->layered = FALSE;
   impl->layered_opacity = 1.0;
 
@@ -608,7 +616,7 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
                             hparent,
                             NULL,
                             _gdk_dll_hinstance,
-                            GDK_SURFACE (impl));
+                            surface);
   impl->handle = hwndNew;
 
   GetWindowRect (hwndNew, &rect);
@@ -638,8 +646,8 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
   GDK_NOTE (MISC, g_print ("... \"%s\" %dx%d@%+d%+d %p = %p\n",
                           title,
                           window_width, window_height,
-                          GDK_SURFACE (impl)->x - offset_x,
-                          GDK_SURFACE (impl)->y - offset_y,
+                          surface->x - offset_x,
+                          surface->y - offset_y,
                           hparent,
                           hwndNew));
 
@@ -652,7 +660,7 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
       return NULL;
     }
 
-  _gdk_win32_surface_enable_transparency (GDK_SURFACE (impl));
+  _gdk_win32_surface_enable_transparency (surface);
 
   g_signal_connect (frame_clock,
                     "after-paint",
@@ -661,7 +669,7 @@ _gdk_win32_display_create_surface (GdkDisplay     *display,
 
   g_object_unref (frame_clock);
 
-  return GDK_SURFACE (impl);
+  return surface;
 }
 
 static void